package com.lex.crossgate.admin.common.utils;

import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageInfo;

import java.util.List;

/**
 * java类简单作用描述
 *
 * @ProjectName: crossgate
 * @Package: com.lex.crossgate.admin.common.utils
 * @ClassName: ${TYPE_NAME}
 * @Description: java类作用描述
 * @Author: 李贝留斯
 * @CreateDate: 2018/5/9 16:37
 * @Version: 1.0
 **/
public class JsonDataFormate {

    public static JSONObject piecing(List<?> list, PageInfo pageInfo){
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("code",0);
        jsonObject.put("msg", "加载成功");
        jsonObject.put("count", pageInfo.getTotal());
        jsonObject.put("data", list);
        return  jsonObject;
    }
}
